<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>现代CI/CD实践指南 | 技术小馆</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.6;
        }
        h1, h2, h3, h4, h5, h6 {
            font-family: 'Noto Serif SC', serif;
            font-weight: 600;
            color: #1a1a1a;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
        }
        .code-block {
            background-color: #2d2d2d;
            color: #f8f8f2;
            border-radius: 8px;
            position: relative;
        }
        .code-block::before {
            content: '';
            position: absolute;
            top: 12px;
            left: 12px;
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background: #ff5f56;
            box-shadow: 20px 0 #ffbd2e, 40px 0 #27c93f;
        }
        .card-hover {
            transition: all 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        }
        .highlight-text {
            position: relative;
            z-index: 1;
        }
        .highlight-text::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 30%;
            background-color: rgba(110, 142, 251, 0.3);
            z-index: -1;
            transition: all 0.3s ease;
        }
        .highlight-text:hover::after {
            height: 50%;
        }
        .first-letter::first-letter {
            font-size: 3.5em;
            float: left;
            line-height: 0.8;
            margin-right: 0.2em;
            color: #6e8efb;
            font-weight: bold;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 px-4 md:py-32">
        <div class="container mx-auto max-w-6xl">
            <div class="flex flex-col md:flex-row items-center">
                <div class="md:w-1/2 mb-10 md:mb-0">
                    <h1 class="text-4xl md:text-5xl font-bold mb-6 leading-tight">现代CI/CD实践指南</h1>
                    <p class="text-xl mb-8 opacity-90">加速软件交付的自动化艺术</p>
                    <div class="flex space-x-4">
                        <a href="#concepts" class="bg-white text-indigo-600 px-6 py-3 rounded-lg font-semibold hover:bg-gray-100 transition duration-300">核心概念</a>
                        <a href="#principles" class="border-2 border-white text-white px-6 py-3 rounded-lg font-semibold hover:bg-white hover:text-indigo-600 transition duration-300">设计原则</a>
                    </div>
                </div>
                <div class="md:w-1/2">
                    <div class="bg-white bg-opacity-20 p-6 rounded-xl backdrop-blur-sm">
                        <div class="mermaid">
                            graph LR
                            A[代码提交] --> B[自动构建]
                            B --> C[单元测试]
                            C --> D[代码质量检查]
                            D --> E[生成构件]
                            E --> F[部署测试环境]
                            F --> G[端到端测试]
                            G --> H{是否通过?}
                            H -->|是| I[部署生产环境]
                            H -->|否| J[通知团队]
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <main class="container mx-auto max-w-6xl px-4 py-12">
        <!-- Introduction -->
        <section class="mb-16">
            <p class="text-xl text-gray-700 first-letter mb-6">
                在现代软件开发中，持续集成（CI，Continuous Integration）和持续部署（CD，Continuous Deployment 或 Continuous Delivery）已成为提升开发效率、保障代码质量的核心实践。合理设计 CI/CD 流水线，不仅能大幅减少人工介入，还能加快交付周期，让开发团队专注于核心业务逻辑。
            </p>
        </section>

        <!-- Core Concepts -->
        <section id="concepts" class="mb-20">
            <h2 class="text-3xl font-bold mb-8 pb-2 border-b-2 border-indigo-100 inline-block">一、CI/CD 的核心概念</h2>
            <p class="text-gray-700 mb-8">在深入 CI/CD 细节之前，我们先理解 CI/CD 的作用及关键区别：</p>

            <div class="grid md:grid-cols-3 gap-8">
                <!-- CI Card -->
                <div class="bg-white rounded-xl shadow-md overflow-hidden card-hover">
                    <div class="bg-indigo-500 p-4 text-white">
                        <div class="flex items-center">
                            <i class="fas fa-code-branch text-2xl mr-3"></i>
                            <h3 class="text-xl font-bold">持续集成（CI）</h3>
                        </div>
                    </div>
                    <div class="p-6">
                        <p class="text-gray-700 mb-4">持续集成的目标是<strong class="highlight-text">确保每次代码变更后，都能自动化构建、测试和集成</strong>，从而尽早发现问题。</p>
                        <ul class="text-gray-600 space-y-2">
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-indigo-500 mt-1 mr-2"></i>
                                <span>代码提交（Commit）</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-indigo-500 mt-1 mr-2"></i>
                                <span>自动构建（Build）</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-indigo-500 mt-1 mr-2"></i>
                                <span>单元测试（Unit Test）</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-indigo-500 mt-1 mr-2"></i>
                                <span>代码质量检查（Lint、SonarQube）</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-indigo-500 mt-1 mr-2"></i>
                                <span>生成构件（Artifact，如 JAR、Docker 镜像）</span>
                            </li>
                        </ul>
                    </div>
                </div>

                <!-- CD Delivery Card -->
                <div class="bg-white rounded-xl shadow-md overflow-hidden card-hover">
                    <div class="bg-purple-500 p-4 text-white">
                        <div class="flex items-center">
                            <i class="fas fa-truck text-2xl mr-3"></i>
                            <h3 class="text-xl font-bold">持续交付（CD）</h3>
                        </div>
                    </div>
                    <div class="p-6">
                        <p class="text-gray-700 mb-4">持续交付的目标是<strong class="highlight-text">让代码随时可以安全地部署到生产环境</strong>，但仍需要人工确认发布。</p>
                        <ul class="text-gray-600 space-y-2">
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-purple-500 mt-1 mr-2"></i>
                                <span>部署到测试环境（Staging）</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-purple-500 mt-1 mr-2"></i>
                                <span>运行端到端测试（E2E）</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-purple-500 mt-1 mr-2"></i>
                                <span>代码审核（Code Review）</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-purple-500 mt-1 mr-2"></i>
                                <span>人工触发部署</span>
                            </li>
                        </ul>
                    </div>
                </div>

                <!-- CD Deployment Card -->
                <div class="bg-white rounded-xl shadow-md overflow-hidden card-hover">
                    <div class="bg-pink-500 p-4 text-white">
                        <div class="flex items-center">
                            <i class="fas fa-rocket text-2xl mr-3"></i>
                            <h3 class="text-xl font-bold">持续部署（CD）</h3>
                        </div>
                    </div>
                    <div class="p-6">
                        <p class="text-gray-700 mb-4">持续部署的目标是<strong class="highlight-text">完全自动化发布</strong>，任何代码变更只要通过 CI 任务，就会自动发布到生产环境。</p>
                        <div class="bg-gray-100 p-4 rounded-lg">
                            <p class="text-sm text-gray-600"><i class="fas fa-info-circle text-pink-500 mr-2"></i>持续部署是持续交付的更进一步，适合成熟度高的团队。</p>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Principles -->
        <section id="principles" class="mb-20">
            <h2 class="text-3xl font-bold mb-8 pb-2 border-b-2 border-indigo-100 inline-block">二、CI/CD 流水线设计原则</h2>

            <div class="grid md:grid-cols-2 gap-8 mb-12">
                <!-- Principle 1 -->
                <div class="bg-white p-6 rounded-xl shadow-md card-hover">
                    <div class="flex items-center mb-4">
                        <div class="bg-indigo-100 text-indigo-600 w-10 h-10 rounded-full flex items-center justify-center mr-4">
                            <i class="fas fa-robot text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold">自动化构建和测试</h3>
                    </div>
                    <ul class="text-gray-600 space-y-2">
                        <li class="flex items-start">
                            <i class="fas fa-check text-indigo-500 mt-1 mr-2"></i>
                            <span>采用<strong>主干开发（Trunk-Based Development）</strong>，避免长时间分支开发</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check text-indigo-500 mt-1 mr-2"></i>
                            <span>代码提交后立即触发<strong>自动化测试</strong>，包括单元测试、集成测试、UI 测试等</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check text-indigo-500 mt-1 mr-2"></i>
                            <span>避免手动操作，提高交付一致性</span>
                        </li>
                    </ul>
                </div>

                <!-- Principle 2 -->
                <div class="bg-white p-6 rounded-xl shadow-md card-hover">
                    <div class="flex items-center mb-4">
                        <div class="bg-blue-100 text-blue-600 w-10 h-10 rounded-full flex items-center justify-center mr-4">
                            <i class="fas fa-tachometer-alt text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold">快速反馈</h3>
                    </div>
                    <ul class="text-gray-600 space-y-2">
                        <li class="flex items-start">
                            <i class="fas fa-check text-blue-500 mt-1 mr-2"></i>
                            <span>采用<strong>增量构建</strong>，避免整个项目重新构建</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check text-blue-500 mt-1 mr-2"></i>
                            <span>使用<strong>并行流水线（Parallel Pipeline）</strong>，加速测试执行</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check text-blue-500 mt-1 mr-2"></i>
                            <span>提供<strong>详细日志和错误报告</strong>，加快问题定位</span>
                        </li>
                    </ul>
                </div>

                <!-- Principle 3 -->
                <div class="bg-white p-6 rounded-xl shadow-md card-hover">
                    <div class="flex items-center mb-4">
                        <div class="bg-green-100 text-green-600 w-10 h-10 rounded-full flex items-center justify-center mr-4">
                            <i class="fas fa-shield-alt text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold">隔离不同环境</h3>
                    </div>
                    <ul class="text-gray-600 space-y-2">
                        <li class="flex items-start">
                            <i class="fas fa-check text-green-500 mt-1 mr-2"></i>
                            <span>代码应先部署到<strong>开发环境（Dev）</strong>，再推广到<strong>测试环境（QA）</strong>、<strong>预发布（Staging）</strong>，最后进入<strong>生产环境（Prod）</strong></span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check text-green-500 mt-1 mr-2"></i>
                            <span>采用<strong>蓝绿部署（Blue-Green Deployment）</strong> 或 <strong>金丝雀发布（Canary Release）</strong> 降低风险</span>
                        </li>
                    </ul>
                </div>

                <!-- Principle 4 -->
                <div class="bg-white p-6 rounded-xl shadow-md card-hover">
                    <div class="flex items-center mb-4">
                        <div class="bg-red-100 text-red-600 w-10 h-10 rounded-full flex items-center justify-center mr-4">
                            <i class="fas fa-lock text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold">安全与合规</h3>
                    </div>
                    <ul class="text-gray-600 space-y-2">
                        <li class="flex items-start">
                            <i class="fas fa-check text-red-500 mt-1 mr-2"></i>
                            <span>代码变更前需<strong>代码审核（Code Review）</strong>，防止不合格代码进入生产</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check text-red-500 mt-1 mr-2"></i>
                            <span>集成<strong>静态代码扫描（SAST）</strong> 和 <strong>动态安全测试（DAST）</strong>，防止安全漏洞</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check text-red-500 mt-1 mr-2"></i>
                            <span>限制生产环境变更权限，采用<strong>最小权限原则（Least Privilege）</strong></span>
                        </li>
                    </ul>
                </div>
            </div>

            <div class="bg-white rounded-xl shadow-md overflow-hidden mb-12">
                <div class="bg-gray-800 text-white p-4">
                    <div class="flex items-center">
                        <i class="fas fa-project-diagram text-xl mr-3"></i>
                        <h3 class="text-xl font-bold">环境隔离与部署策略</h3>
                    </div>
                </div>
                <div class="p-6">
                    <div class="mermaid">
                        graph TD
                        A[开发环境 Dev] -->|自动化测试通过| B[测试环境 QA]
                        B -->|人工验收通过| C[预发布 Staging]
                        C -->|最终验证通过| D[生产环境 Prod]
                        D --> E{部署策略}
                        E --> F[蓝绿部署]
                        E --> G[金丝雀发布]
                        E --> H[滚动更新]
                    </div>
                </div>
            </div>
        </section>

        <!-- Jenkins Implementation -->
        <section class="mb-20">
            <h2 class="text-3xl font-bold mb-8 pb-2 border-b-2 border-indigo-100 inline-block">三、Jenkins 实现 CI/CD 流水线</h2>

            <div class="mb-8">
                <h3 class="text-2xl font-semibold mb-4 flex items-center">
                    <i class="fas fa-cog text-indigo-500 mr-3"></i>
                    Jenkinsfile 基本结构
                </h3>
                <p class="text-gray-700 mb-6">Jenkins 使用 <strong>Jenkinsfile</strong> 定义流水线。一个基础的 CI/CD 流水线如下：</p>
                
                <div class="code-block p-4 mb-6">
                    <pre class="overflow-x-auto"><code class="language-groovy">pipeline {
    agent any  // 在任何可用的 Agent 运行
    stages {
        stage('Clone Repository') {
            steps {
                git 'https://github.com/your-repo.git'
            }
        }
        stage('Build') {
            steps {
                sh './gradlew build'  // 适用于 Gradle 项目，Maven 项目可以用 `mvn clean package`
            }
        }
        stage('Unit Test') {
            steps {
                sh './gradlew test'
            }
        }
        stage('Code Analysis') {
            steps {
                sh 'sonar-scanner'
            }
        }
        stage('Deploy to Staging') {
            steps {
                sh './deploy.sh staging'
            }
        }
        stage('Deploy to Production') {
            when {
                branch 'main'
            }
            steps {
                sh './deploy.sh production'
            }
        }
    }
}</code></pre>
                </div>

                <div class="bg-blue-50 p-4 rounded-lg border border-blue-100">
                    <h4 class="font-bold text-blue-700 mb-2 flex items-center">
                        <i class="fas fa-info-circle mr-2"></i>
                        解读：
                    </h4>
                    <ul class="text-blue-700 space-y-2">
                        <li class="flex items-start">
                            <i class="fas fa-angle-right mt-1 mr-2"></i>
                            <span><strong>Git 克隆代码</strong>：拉取最新代码</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-angle-right mt-1 mr-2"></i>
                            <span><strong>Build 阶段</strong>：执行构建</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-angle-right mt-1 mr-2"></i>
                            <span><strong>单元测试</strong>：运行 <code>test</code> 确保代码可用</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-angle-right mt-1 mr-2"></i>
                            <span><strong>代码质量检查</strong>：使用 <code>SonarQube</code> 等工具分析代码</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-angle-right mt-1 mr-2"></i>
                            <span><strong>部署 Staging</strong>：仅当 <code>develop</code> 分支触发时才部署到测试环境</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-angle-right mt-1 mr-2"></i>
                            <span><strong>生产部署</strong>：仅当 <code>main</code> 分支提交时自动发布</span>
                        </li>
                    </ul>
                </div>
            </div>

            <div>
                <h3 class="text-2xl font-semibold mb-4 flex items-center">
                    <i class="fab fa-docker text-blue-500 mr-3"></i>
                    Jenkins 结合 Docker
                </h3>
                <p class="text-gray-700 mb-4">为了提升构建效率，可以使用 Docker 进行环境隔离。例如：</p>
                <div class="code-block p-4">
                    <pre class="overflow-x-auto"><code class="language-groovy">agent {
    docker {
        image 'maven:3.8.1-jdk-11'
    }
}</code></pre>
                </div>
            </div>
        </section>

        <!-- GitHub Actions -->
        <section class="mb-20">
            <h2 class="text-3xl font-bold mb-8 pb-2 border-b-2 border-indigo-100 inline-block">四、GitHub Actions 实现 CI/CD</h2>

            <p class="text-gray-700 mb-6">GitHub Actions 允许你在 GitHub 直接构建流水线，<code>yaml</code> 配置如下：</p>
            
            <div class="code-block p-4 mb-6">
                <pre class="overflow-x-auto"><code class="language-yaml">name: Java CI/CD Pipeline

on:
  push:
    branches:
      - main

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Code
        uses: actions/checkout@v2

      - name: Setup JDK
        uses: actions/setup-java@v2
        with:
          distribution: 'temurin'
          java-version: '11'

      - name: Build Project
        run: mvn clean package

      - name: Run Tests
        run: mvn test

      - name: Deploy to Production
        if: github.ref == 'refs/heads/main'
        run: ./deploy.sh production</code></pre>
            </div>

            <div class="bg-purple-50 p-4 rounded-lg border border-purple-100">
                <h4 class="font-bold text-purple-700 mb-2 flex items-center">
                    <i class="fas fa-star mr-2"></i>
                    GitHub Actions 特点：
                </h4>
                <ul class="text-purple-700 space-y-2">
                    <li class="flex items-start">
                        <i class="fas fa-check-circle mt-1 mr-2"></i>
                        <span>代码变更时自动触发</span>
                    </li>
                    <li class="flex items-start">
                        <i class="fas fa-check-circle mt-1 mr-2"></i>
                        <span><strong>无服务器（Serverless）</strong>，无需维护 CI/CD 服务器</span>
                    </li>
                    <li class="flex items-start">
                        <i class="fas fa-check-circle mt-1 mr-2"></i>
                        <span>适用于小型项目</span>
                    </li>
                </ul>
            </div>
        </section>

        <!-- Best Practices -->
        <section>
            <h2 class="text-3xl font-bold mb-8 pb-2 border-b-2 border-indigo-100 inline-block">五、CI/CD 最佳实践</h2>

            <div class="grid md:grid-cols-3 gap-6 mb-8">
                <!-- Practice 1 -->
                <div class="bg-white p-5 rounded-xl shadow-sm border border-gray-200">
                    <div class="flex items-center mb-3">
                        <div class="bg-orange-100 text-orange-600 w-8 h-8 rounded-full flex items-center justify-center mr-3">
                            <i class="fas fa-stopwatch"></i>
                        </div>
                        <h3 class="font-bold">减少流水线执行时间</h3>
                    </div>
                    <ul class="text-gray-600 text-sm space-y-2">
                        <li class="flex items-start">
                            <i class="fas fa-circle text-xs mt-1.5 mr-2 text-orange-500"></i>
                            <span>采用 <strong>缓存（Cache）</strong> 技术，例如 Maven 或 Gradle 构建缓存</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-circle text-xs mt-1.5 mr-2 text-orange-500"></i>
                            <span>运行 <strong>增量构建</strong>，仅编译变更的代码</span>
                        </li>
                    </ul>
                </div>

                <!-- Practice 2 -->
                <div class="bg-white p-5 rounded-xl shadow-sm border border-gray-200">
                    <div class="flex items-center mb-3">
                        <div class="bg-green-100 text-green-600 w-8 h-8 rounded-full flex items-center justify-center mr-3">
                            <i class="fas fa-server"></i>
                        </div>
                        <h3 class="font-bold">保证高可用性</h3>
                    </div>
                    <ul class="text-gray-600 text-sm space-y-2">
                        <li class="flex items-start">
                            <i class="fas fa-circle text-xs mt-1.5 mr-2 text-green-500"></i>
                            <span>采用 <strong>多 Agent 并行执行</strong>，避免构建任务堵塞</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-circle text-xs mt-1.5 mr-2 text-green-500"></i>
                            <span>监控流水线性能，优化慢速构建步骤</span>
                        </li>
                    </ul>
                </div>

                <!-- Practice 3 -->
                <div class="bg-white p-5 rounded-xl shadow-sm border border-gray-200">
                    <div class="flex items-center mb-3">
                        <div class="bg-red-100 text-red-600 w-8 h-8 rounded-full flex items-center justify-center mr-3">
                            <i class="fas fa-undo"></i>
                        </div>
                        <h3 class="font-bold">自动化回滚</h3>
                    </div>
                    <ul class="text-gray-600 text-sm space-y-2">
                        <li class="flex items-start">
                            <i class="fas fa-circle text-xs mt-1.5 mr-2 text-red-500"></i>
                            <span>部署失败时，自动回滚到上一个稳定版本</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-circle text-xs mt-1.5 mr-2 text-red-500"></i>
                            <span>结合 <strong>Feature Flags（特性开关）</strong>，避免问题影响所有用户</span>
                        </li>
                    </ul>
                </div>
            </div>

            <div class="bg-indigo-50 p-6 rounded-xl">
                <div class="flex items-start">
                    <div class="bg-indigo-100 text-indigo-600 p-3 rounded-full mr-4">
                        <i class="fas fa-lightbulb text-xl"></i>
                    </div>
                    <div>
                        <h3 class="text-xl font-bold text-indigo-800 mb-2">专家建议</h3>
                        <p class="text-indigo-700">成功的CI/CD实施需要团队文化和工具链的共同演进。建议从小规模开始，逐步完善流水线，同时培养团队的自动化意识和持续改进习惯。</p>
                    </div>
                </div>
            </div>
        </section>
    </main>

    <!-- Footer -->
    <footer class="bg-gray-900 text-gray-300 py-8">
        <div class="container mx-auto max-w-6xl px-4">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-4 md:mb-0">
                    <h3 class="text-xl font-bold text-white mb-1">技术小馆</h3>
                    <p class="text-sm">专业的软件开发知识库</p>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" class="text-indigo-300 hover:text-white transition duration-300">
                        <i class="fas fa-external-link-alt mr-2"></i>http://www.yuque.com/jtostring
                    </a>
                </div>
            </div>
            <div class="mt-8 pt-6 border-t border-gray-800 text-center text-sm">
                <p>© 2023 技术小馆. 保留所有权利.</p>
            </div>
        </div>
    </footer>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'dark',
            flowchart: {
                useMaxWidth: false,
                htmlLabels: true,
                curve: 'basis'
            }
        });
    </script>
</body>
</html>